function validate(value) {
    /* return支持返回boolean类型或者{ success: boolean, message?: string }对象，
       返回对象格式时success为必填，message为选填，当message有值时错误提示信息将
       改为message设置的提示信息 */
    const self = this;
    const yearPattern = /^(19|20)\d{2}$/;

    return new Promise((resolve, reject) => {
        // 输入验证：确保 value 是字符串类型
        if (typeof value !== "string") {
            resolve({ success: false, message: "请输入有效的年份（1900-2099）" });
            return;
        }

        // 年份格式验证
        if (!yearPattern.test(value)) {
            resolve({ success: false, message: "请输入有效的年份（1900-2099）" });
            return;
        }

        // 构造参数
        const params = [
            { name: "cardId", valueContent: self.$$("number_input_43ljyh").cValue },
            { name: "verifyYear", valueContent: value }
        ];

        // 调用 API
        api.DATA_SOURCE_EXECUTE("d2bdec11-af34-45f5-ad1b-3a2e546a5081", "api", params, [], "")
            .then((res) => {
                try {
                    const result = JSON.parse(res.result);
                    if (result.result.id !== -1) {
                        resolve({ success: false, message: "该年度已年检" });
                    } else {
                        resolve({ success: true });
                    }
                } catch (e) {
                    // 捕获 JSON 解析错误
                    reject({ success: false, message: "系统错误，请联系管理员" });
                }
            })
            .catch((error) => {
                // 捕获 API 调用错误
                resolve({ success: false, message: "系统繁忙，请稍后再试" });
            });
    });
}
